var limsMethodCertificate = Gikam.getPageObject({

    /**
     * 审核记录
     */
    getFlowListColumns: function () {
        return [{
            index: true
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.TASKNAME',
            field: 'taskName',
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.USER',
            field: 'auditedByName'
        }, {
            title: 'T_CORE_INTERNAL_AUDIT.AUDITDATE',
            field: 'auditedTime',
            width: 140
        }, {
            title: 'GIKAM.WORKFLOW.PASS.OPINION.TITLE',
            field: 'comment',
            width: 300
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.COMMENT.ROUTE',
            field: 'route',
            width: 140
        }]
    },


    getEditListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true}, {
            field : 'ext$.methodcode',
            title : 'T_LIMS_METHOD.METHODCODE'
        }, {
            field : 'ext$.methoddesc',
            title : 'T_LIMS_METHOD.METHODDESC'
        }, {
            field : 'ext$.methodtype',
            title : 'T_LIMS_METHOD.METHODTYPE',
            type : 'select',
            category: 'sys',
            firstBlank : false,
            param: {
                codeCategoryId: 'sopCategory'
            }
        }, {
            field : 'certdate',
            title : 'T_LIMS_METHOD_CERTIFICATE.CERTDATE',
            type:'date',
            editor: true,
            validators : ['notEmpty'],
           /* onChange: function (field, value, oldvalue, index, text) {
                var _this = this;
                let row = _this.getData()[index];
                debugger
                /!*var expdate = row.expdate;
                console.log('expdate '+expdate)*!/
                if(Gikam.isEmpty(row.expdate)){
                    this.setData({
                        certdate: value
                    })
                }else if(value>row.expdate){
                    Gikam.alert('T_LIMS_METHOD.METHODTYPE.CERTDATE.TIP')//授权开始日期必须小于授权结束日期
                    return
                }else {
                    this.setData({
                        certdate: value
                    })
                }

            }*/
        }, {
            field : 'expdate',
            title : 'T_LIMS_METHOD_CERTIFICATE.EXPDATE',
            type:'date',
            editor: true,
            validators : ['notEmpty'],
            /*onChange: function (field, value, oldvalue, index, text) {
                var _this = this;
                let row = _this.getData()[index];
                var certdate = row.certdate;
                console.log('certdate '+certdate)
                if(Gikam.isEmpty(certdate)){
                    this.setData({
                        expdate: value
                    })
                }else if(value<certdate){
                    Gikam.alert('T_LIMS_METHOD.METHODTYPE.CERTDATE.TIP')//授权开始日期必须小于授权结束日期
                    return
                }else {
                    this.setData({
                        expdate: value
                    })
                }
            }*/
        }, /*{
            field : 'remark',
            title : 'T_LIMS_METHOD_CERTIFICATE.REMARK',
            editor: true,
            type : 'richText',
        } */];
    },

    getBaseInfoFormFields : function() {
        return [ {
            field : 'certdate',
            title : 'T_LIMS_METHOD_CERTIFICATE.CERTDATE',
            type:'date',
            preInsert : true,
            validators : ['notEmpty'],
        }, {
            field : 'expdate',
            title : 'T_LIMS_METHOD_CERTIFICATE.EXPDATE',
            type:'date',
            preInsert : true,
            validators : ['notEmpty'],
        }];
    },

    getAuditListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true},Gikam.status.getBpmnColumn(limsMethodCertificate.workflow.dbTable), {
            field : 'remark',
            title : 'T_LIMS_METHOD_CERTIFICATE.REMARK'
        } ];
    },

    getSearchListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true},Gikam.status.getBpmnColumn(limsMethodCertificate.workflow.dbTable), {
            field : 'remark',
            title : 'T_LIMS_METHOD_CERTIFICATE.REMARK'
        } ];
    },

    getChooseListColumns : function() {
        return [{index: true}, {
            field : 'remark',
            title : 'T_LIMS_METHOD_CERTIFICATE.REMARK'
        } ];
    },

    baseUrl : IFM_CONTEXT + '/secure/basemodule/coredata/method-certificates',
    auditRecordUrl: IFM_CONTEXT + '/secure/baseline/auditrecord',

    workflow : {
        dbTable : 'T_LIMS_METHOD_CERTIFICATE',
        columns : [ {
            field : 'id',
            title : 'T_LIMS_METHOD_CERTIFICATE.ID'
        } ]
    }

});
